﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.DialogUI {
    import flash.events.*;
    import Engine.Managers.*;
    import flash.display.*;
    import Events.*;
    import flash.utils.*;
    import org.aswing.*;
    import Classes.*;
    import Display.*;
    import flash.text.*;
    import Display.aswingui.*;
    import com.zynga.skelly.util.*;

    public class SocialLevelUpDialogView extends GenericDialogView {

        protected var m_level:int;
        protected var m_rewardGoods:int;
        protected var m_dialogIcon:String;
        protected var m_titleIcon:String;
        protected var m_pic:Loader;
        protected var m_levelIconPane;
        protected var m_panelDict:Dictionary;
        protected var socialTitlePanel:JPanel;

        public function SocialLevelUpDialogView(_arg1:Dictionary, _arg2:String="", _arg3:String="", _arg4:int=0, _arg5:Function=null, _arg6:String="", _arg7:int=0, _arg8:int=0, _arg9:int=0, _arg10:String="", _arg11:String=""){
            this.m_level = _arg8;
            this.m_rewardGoods = _arg9;
            this.m_dialogIcon = _arg10;
            this.m_titleIcon = _arg11;
            super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
            this.socialTitlePanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
        }
        protected function createTitleIconPane():JPanel{
            var iconPane:* = null;
            var iconLoader:* = null;
            iconPane = new AssetPane();
            var iconString:* = Global.getAssetURL(this.m_titleIcon);
            iconLoader = LoadingManager.load(iconString, Curry.curry(function (_arg1:JPanel, _arg2:Event):void{
                iconPane.setAsset(iconLoader.content);
                ASwingHelper.prepare(_arg1);
                _arg1.dispatchEvent(new UIEvent(UIEvent.REFRESH_DIALOG, "iconLoaded", true));
            }, this));
            var iconInnerPane:* = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER, 50);
            iconInnerPane.append(iconPane);
            return (iconInnerPane);
        }
        override protected function createTitlePanel():JPanel{
            var _local1:JPanel = this.createTitleIconPane();
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER, -35);
            this.socialTitlePanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local3:String = Global.getAssetURL(this.m_titleIcon);
            var _local4:String = this.m_level.toString();
            var _local5:JTextField = ASwingHelper.makeTextField(_local4, EmbeddedArt.TITLE_FONT, 26, 0xFFFFFF);
            _local5.filters = EmbeddedArt.socialLevelUpTitleFilters;
            _local2.append(_local1);
            ASwingHelper.setEasyBorder(_local5, 3);
            _local2.append(_local5);
            _local2.setPreferredWidth(43);
            var _local6:String = ZLoc.t("Dialogs", (m_titleString + "_title"));
            title = ASwingHelper.makeTextField(_local6, EmbeddedArt.TITLE_FONT, m_titleFontSize, EmbeddedArt.titleColor);
            title.filters = EmbeddedArt.titleFilters;
            var _local7:TextFormat = new TextFormat();
            _local7.size = m_titleSmallCapsFontSize;
            TextFieldUtil.formatSmallCaps(title.getTextField(), _local7);
            this.socialTitlePanel.append(_local2);
            this.socialTitlePanel.append(ASwingHelper.horizontalStrut(10));
            this.socialTitlePanel.append(title);
            title.getTextField().height = (m_titleFontSize * 1.5);
            return (this.socialTitlePanel);
        }
        override protected function createTextComponent(_arg1:Number):Component{
            var _local2:Component;
            var _local3:Number = TextFieldUtil.getLocaleFontSize(19, 17, [{
                locale:"fr",
                size:15
            }]);
            var _local4:String = ZLoc.t("Dialogs", "CollectionTradeInReward");
            var _local5:JTextField = ASwingHelper.makeTextField((_local4 + " "), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 15, EmbeddedArt.blueTextColor);
            var _local6:String = ZLoc.t("Dialogs", "GoodsSuffix", {amount:this.m_rewardGoods});
            var _local7:JTextField = ASwingHelper.makeTextField((_local6 + "  "), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, _local3, EmbeddedArt.blueTextColor);
            var _local8:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.TOP);
            _local8.append(ASwingHelper.verticalStrut(10));
            _local8.append(_local5);
            var _local9:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.LEFT);
            _local9.append(_local8);
            _local9.append(ASwingHelper.horizontalStrut(10));
            _local9.append(_local7);
            _local9.setPreferredWidth(_arg1);
            _local9.setMinimumWidth(_arg1);
            _local9.setMaximumWidth(_arg1);
            var _local10:JPanel = ASwingHelper.horizontalStrut(_arg1);
            var _local11:Component = ASwingHelper.makeMultilineText(m_message, _arg1, EmbeddedArt.DEFAULT_FONT_NAME_BOLD, TextFormatAlign.LEFT, 15, EmbeddedArt.brownTextColor);
            var _local12:Container = ASwingHelper.makeSoftBoxJPanelVertical();
            _local12.append(_local9);
            _local12.append(_local10);
            _local12.append(_local11);
            _local2 = _local12;
            return (_local2);
        }

    }
}//package Display.DialogUI 
